//
//  NSDate+NED.h
//  MoreCoin
//
//  Created by 林宁宁 on 2019/10/11.
//  Copyright © 2019 MoreCoin. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSDate (NED)


@property (nonatomic, readonly) NSInteger year; ///< Year component
@property (nonatomic, readonly) NSInteger month; ///< Month component (1~12)
@property (nonatomic, readonly) NSInteger day; ///< Day component (1~31)
@property (nonatomic, readonly) NSInteger hour; ///< Hour component (0~23)
@property (nonatomic, readonly) NSInteger minute; ///< Minute component (0~59)
@property (nonatomic, readonly) NSInteger second; ///< Second component (0~59)
@property (nonatomic, readonly) NSInteger nanosecond; ///< Nanosecond component
@property (nonatomic, readonly) NSInteger weekday; ///< Weekday component (1~7, first day is based on user setting)
@property (nonatomic, readonly) NSInteger weekdayOrdinal; ///< WeekdayOrdinal component
@property (nonatomic, readonly) NSInteger weekOfMonth; ///< WeekOfMonth component (1~5)
@property (nonatomic, readonly) NSInteger weekOfYear; ///< WeekOfYear component (1~53)
@property (nonatomic, readonly) NSInteger yearForWeekOfYear; ///< YearForWeekOfYear component
@property (nonatomic, readonly) NSInteger quarter; ///< Quarter component
@property (nonatomic, readonly) BOOL isLeapMonth; ///< whether the month is leap month
@property (nonatomic, readonly) BOOL isLeapYear; ///< whether the year is leap year
@property (nonatomic, readonly) BOOL isToday; ///< whether date is today (based on current locale)
@property (nonatomic, readonly) BOOL isYesterday; ///< whether date is yesterday (based on current locale)

/** 转时间字符串
 为空默认 yyyy-MM-dd HH:mm:ss 格式
 */
- (NSString *)ned_stringByFormate:(NSString * _Nullable )formate;

+ (NSTimeInterval)ned_timestamp;

/// 转成时间戳 -> 月日格式显示
+ (NSString *)ned_timestampToDayFormat:(NSInteger)timestamp;


- (NSString *)ned_dateWeekday;

- (NSString *)ned_identifyToDay;

- (NSString *)ned_timesTemp;

- (NSDate *)ned_dateByAddingYears:(NSInteger)years;
- (NSDate *)ned_dateByAddingMonths:(NSInteger)months;
- (NSDate *)ned_dateByAddingWeeks:(NSInteger)weeks;
- (NSDate *)ned_dateByAddingDays:(NSInteger)days;
- (NSDate *)ned_dateByAddingHours:(NSInteger)hours;
- (NSDate *)ned_dateByAddingMinutes:(NSInteger)minutes;
- (NSDate *)ned_dateByAddingSeconds:(NSInteger)seconds;

/// 时间戳
+ (NSString *)ned_nowTime;
/// 时间戳 毫秒
+ (NSInteger)ned_timeTempMillisecond;
/// 时间戳
+ (NSInteger)ned_timeTemp;
/// 是否同一天
+ (BOOL)isSameDay:(NSDate*)date1 date2:(NSDate*)date2;

@end

NS_ASSUME_NONNULL_END
